{% load staticfiles %}

<!DOCTYPE html>
<html>

<head>
    <title>{% block title %}{% endblock %}</title>
    <link href="{% static "css/bootstrap.min.css" %}" rel="stylesheet">
    <link href="{% static "css/index.css" %}" rel="stylesheet">
    <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>

    <script src="{% static "js/jquery-2.2.0.min.js" %}"></script>
    <script src="{% static "js/bootstrap.min.js" %}"></script>
</head>

<body>
    <nav class="navbar navbar-default navbar-inverse">
        <div class="container-fluid">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="{% url 'tweets:index' %}">Kweets</a>
            </div>

            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li {% if section == "index" %}class="active"{% endif %} >
                        <a href="#">
                            Home
                            <span class="sr-only">(current)</span>
                        </a>
                    </li>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                            <span class="glyphicon glyphicon-user" aria-hidden="true"></span>
                                {% if request.user.is_authenticated %}
                                    {{ request.user.username }}
                                {% else %}
                                    User
                                {% endif %}
                            <span class="caret"></span>
                        </a>
                        <ul class="dropdown-menu">
                            {% if request.user.is_authenticated %}
                                <li><a href="{% url 'account:password_change' %}">Change Password</a></li>
                                <li role="separator" class="divider"></li>
                                <li><a href="{% url 'account:logout' %}">Logout</a></li>
                            {% else %}
                                 <li><a href="{% url 'account:login' %}">Login</a></li>
                                 <li role="separator" class="divider"></li>
                                 <li><a href="{% url 'account:register' %}">Register</a></li>
                            {% endif %}
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </nav>
    
    <div class="container-fluid">
        {% block content %}{% endblock %}
    </div>
</body>

</html>
